package com.sailing.lianxi.design.factory;

/**
 * 图形工厂
 * @author Administrator
 *
 */
public class ShapeFactory {

	/**
	 * 生成对象的工厂
	 * @param type
	 * @return
	 */
	public Shape getShape(String type){
		if("CIRCLE".equalsIgnoreCase(type)){
			return new Circle();
		}else if("RECTANGLE".equalsIgnoreCase(type)){
			return new Rectangle();
		}else if("SQUARE".equalsIgnoreCase(type)){
			return new Square();
		}else{
			return null;
		}
	}
	
}
